package com.zuo.entity;

import java.util.Date;
import java.util.Objects;

/**
 * @Author 白白旧维
 * @Date 2022/2/28 18:40
 */
public class Bulletin {

    private int bid;
    private User user;
    private String bname;
    private String bcontent;
    private Date bcreateTime;
    private String createTime;

    public Bulletin() {
        this.user = new User();
    }

    public Bulletin(int bid, User user, String bname, String bcontent, Date bcreateTime) {
        this.bid = bid;
        this.user = user;
        this.bname = bname;
        this.bcontent = bcontent;
        this.bcreateTime = bcreateTime;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public int getBid() {
        return bid;
    }

    public void setBid(int bid) {
        this.bid = bid;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getBname() {
        return bname;
    }

    public void setBname(String bname) {
        this.bname = bname;
    }

    public String getBcontent() {
        return bcontent;
    }

    public void setBcontent(String bcontent) {
        this.bcontent = bcontent;
    }

    public Date getBcreateTime() {
        return bcreateTime;
    }

    public void setBcreateTime(Date bcreateTime) {
        this.bcreateTime = bcreateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Bulletin bulletin = (Bulletin) o;
        return bid == bulletin.bid &&
                Objects.equals(user, bulletin.user) &&
                Objects.equals(bname, bulletin.bname) &&
                Objects.equals(bcontent, bulletin.bcontent) &&
                Objects.equals(bcreateTime, bulletin.bcreateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(bid, user, bname, bcontent, bcreateTime);
    }

    @Override
    public String toString() {
        return "Bulletin{" +
                "bid=" + bid +
                ", user=" + user +
                ", bname='" + bname + '\'' +
                ", bcontent='" + bcontent + '\'' +
                ", bcreateTime=" + bcreateTime +
                '}';
    }
}
